<template>
<div class="app-header">
  <div class="clearfix wrap">
    <div class="fl f20" style="font-weight:bold;">云会议会员中心</div>
    <div class="fr">
      <router-link to="/admin/messages">
        <Badge dot :style="{lineHeight: '20px'}">
          <Icon type="ios-notifications-outline" style="color:#fff;" size="24"></Icon>
      </Badge>
    </router-link>
      &nbsp;&nbsp;
      {{userInfo.nickName}}
      &nbsp;&nbsp;
      <Button type="warning" size="small" @click="logout">退出</Button>
      </div>
  </div>
</div>
</template>

<script>
export default {
  data () {
    return {
      userInfo: JSON.parse(sessionStorage.userInfo || '{}')
    }
  },
  methods:{
    logout () {
      let _this = this
      this.$Modal.confirm({
        title: '提示',
        content:'确认退出吗？',
        onOk() {
          sessionStorage.removeItem('token')
          _this.$router.push('/login')
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
@color-primary: #147de5;

.app-header{
  background: @color-primary;
  color: #fff;
}
.wrap{
  padding: 0 20px;
}
</style>
